#ifndef SYMBOL_POOL_H
#define SYMBOL_POOL_H
#include <vector>
#include <assert.h>
#include "jtypes.h"
class SymbolPool 
{
  public:
    SymbolPool();
    ~SymbolPool();

    u2 addSymbol(const char * name);
    u2 getSymbol(const char * name);

    inline const char * getSymbolAt(u2 index)
    {
      assert(index<=names.size());
      return names[index];
    }

    enum {
      no_symbol=0xffff
    };
  private:
    std::vector<char *> names;
};
#endif
